package com.example.project.controller;

import com.example.project.domain.dto.LoginRequest;
import com.example.project.domain.response.Response;
import com.example.project.exception.BusinessException;
import com.example.project.service.UserService;
import com.example.project.utils.JwtUtil;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/users")
@Tag(name = "登陆注册管理", description = "登陆注册相关的API操作")
public class AuthController {
    private static final Logger log = LoggerFactory.getLogger(AuthController.class);

    @Resource
    private UserService userService;

    @PostMapping("/login")
    public Response<String> login(@RequestBody LoginRequest request) {
        return userService.login(request);
    }
}
